package book.service.impl;

import book.dao.tushuDao;
import book.entity.tushu;
import book.service.TushuServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
public class TushuServicesImpl implements TushuServices {


    @Autowired
    private tushuDao tushuDao;

    @Override
    public List<tushu> getAll() {
        return tushuDao.getAll();
    }



    @Override
    public List<tushu> getByPage(int offset, int limit) {
        return null;
    }

    @Override
    public List<tushu> getByPage(int offset, int limit, tushu condition) {
        return tushuDao.getByPage(offset,limit,condition);
    }

    @Override
    public int getCount(tushu condition) {
        return 0;
    }

    @Override
    public void delete(int id) {
        tushuDao.deleteEntity(id);
    }

    @Override
    public void insertEntity(tushu tushu) {
        tushuDao.insertEntity(tushu);
    }


    @Override
    public tushu getById(int id) {
        return tushuDao.getById(id);
    }

    @Override
    public void update(tushu tushu) {
        tushuDao.updateEntity(tushu);

    }

    @Override
    public void updaZT(int id) {
        tushuDao.updaZT(id);
    }


    @Override
    public void batchDel(List<Integer> ids) {
        tushuDao.batchDel(ids);
    }

    @Override
    public int getCountByCondition(tushu condition) {
        return tushuDao.getCountByCondition(condition);
    }

    @Override
    public int updatereturn(int ts_id) {
        return tushuDao.updatereturn(ts_id);
    }

    @Override
    public int updateborrow(int ts_id) {
        return tushuDao.updateborrow(ts_id);
    }

    @Override
    public void updatushu(tushu t) {
        tushuDao.updatushu(t);
    }

    @Override
    public List<tushu> getByPage2(int offset, int limit, tushu condition) {
        return tushuDao.getByPage2(offset,limit,condition);
    }

    @Override
    public void updatezt(int ts_id) {
        tushuDao.updatezt(ts_id);
    }

    @Override
    public List<tushu> tongji() {
        return tushuDao.tongji();
    }

    @Override
    public int getCount2(tushu tushu) {
        return tushuDao.getCount2(tushu);
    }
}
